package com.atguigu.gulimall.auth;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;

/**
 * Spring session核心原理
 * 1）@EnableRedisHttpSession 导入了RedisHttpSessionConfiguration.class配置
 *  1.给容器中添加了一个组件 SessionRepository>>>RedisIndexedSessionRepository：redis操作session。session的添删改查封装类
 *  2.SessionRepositoryFilter=》Filter 每个请求过来必须经过Filter session存储的过滤器
 *      1.创建的时候就自动从容器中获取到了SessionRepository
 *      2.原始的request response都被报装成SessionRepositoryRequestWrapper SessionRepositoryResponseWrapper
 *      3.以后获取session request.getSession()
 *      4.wrappedRequest.getSession()==>SessionRepository中获取的
 *  装饰者模式
 *
 *  自动延期：redis中的数据有过期时间
 */
@EnableFeignClients
@EnableDiscoveryClient
@SpringBootApplication
@EnableRedisHttpSession //整合redis作为session的存储
public class GulimallAuthServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(GulimallAuthServerApplication.class, args);
    }

}
